package com.shwread.android.ui.widget;


import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.PopupWindow;

import com.shwread.android.qysw10000136.R;


public class ManagerClickPopupWindow
        extends
        PopupWindow
        implements
        OnClickListener
{
	private Context  context;
	private IManagerClickPopListener mlistener ;
	private View view;
	private View event_layout;
	private View chat_layout;
	
	public ManagerClickPopupWindow(Context context,IManagerClickPopListener mlistener){
		this.context = context ;
		this.mlistener= mlistener;
		view = LayoutInflater.from(context).inflate(R.layout.new_interation_center_manager_click_pop,null);
		initview();
		initListener();
	}

	private void initview() {
		event_layout = view.findViewById(R.id.new_interaction_manager_pop_event_layout);
		chat_layout = view.findViewById(R.id.new_interaction_manager_pop_chat_layout);
		this.setHeight(LayoutParams.WRAP_CONTENT);
		this.setWidth(LayoutParams.WRAP_CONTENT);
		this.setBackgroundDrawable(new BitmapDrawable());
		this.setOutsideTouchable(false);
		this.setFocusable(true);
		this.setContentView(view);  
    }
	private void initListener() {
		event_layout.setOnClickListener(this);
		chat_layout.setOnClickListener(this);
	}


	@Override
	public void onClick(View view) {
		switch (view.getId()) {
			case R.id.new_interaction_manager_pop_event_layout:
				mlistener.ok(0,this);
				break;
			case R.id.new_interaction_manager_pop_chat_layout:
				mlistener.ok(1,this);
				break;
			
			default:
				break;
		}
	}
	
}
